home *** CD-ROM | disk | FTP | other *** search
/ BMUG PD-ROM A / PD-ROM A.iso / HyperCard / Education / Weights & Measures / card_2074.txt < prev    next >
Encoding:
Text File  |  1991-10-27  |  12.0 KB  |  534 lines

  1. -- card: 2074 from stack: in
  2. -- bmap block id: 10767
  3. -- flags: 0000
  4. -- background id: 2785
  5. -- name: 
  6.  
  7.  
  8. -- part 1 (button)
  9. -- low flags: 00
  10. -- high flags: A002
  11. -- rect: left=22 top=110 right=129 bottom=137
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: Miles/Gallon
  20. ----- HyperTalk script -----
  21. on mouseUp
  22.   ask "Enter Value"
  23.   put it into card field 1
  24.   put it*1.609344/3.785412 into card field 2
  25. end mouseUp
  26.  
  27.  
  28.  
  29. -- part 2 (button)
  30. -- low flags: 00
  31. -- high flags: A002
  32. -- rect: left=22 top=154 right=173 bottom=137
  33. -- title width / last selected line: 0
  34. -- icon id / first selected line: 0 / 0
  35. -- text alignment: 1
  36. -- font id: 0
  37. -- text size: 12
  38. -- style flags: 0
  39. -- line height: 16
  40. -- part name: Kilometer/Liter
  41. ----- HyperTalk script -----
  42. on mouseUp
  43.   ask "Enter Value"
  44.   put it into card field 2
  45.   put it*3.785412/1.609344 into card field 1
  46.  
  47. end mouseUp
  48.  
  49.  
  50.  
  51. -- part 3 (field)
  52. -- low flags: 01
  53. -- high flags: 0002
  54. -- rect: left=22 top=128 right=145 bottom=137
  55. -- title width / last selected line: 0
  56. -- icon id / first selected line: 0 / 0
  57. -- text alignment: 1
  58. -- font id: 0
  59. -- text size: 12
  60. -- style flags: 0
  61. -- line height: 16
  62. -- part name: 
  63.  
  64.  
  65. -- part 4 (field)
  66. -- low flags: 01
  67. -- high flags: 0002
  68. -- rect: left=22 top=172 right=189 bottom=137
  69. -- title width / last selected line: 0
  70. -- icon id / first selected line: 0 / 0
  71. -- text alignment: 1
  72. -- font id: 0
  73. -- text size: 12
  74. -- style flags: 0
  75. -- line height: 16
  76. -- part name: 
  77.  
  78.  
  79. -- part 5 (button)
  80. -- low flags: 00
  81. -- high flags: A002
  82. -- rect: left=188 top=109 right=128 bottom=303
  83. -- title width / last selected line: 0
  84. -- icon id / first selected line: 0 / 0
  85. -- text alignment: 1
  86. -- font id: 0
  87. -- text size: 12
  88. -- style flags: 0
  89. -- line height: 16
  90. -- part name: Degress
  91. ----- HyperTalk script -----
  92. on mouseUp
  93.   ask "Enter Value"
  94.   put it into card field 3
  95.   put it*pi/180 into card field 4
  96. end mouseUp
  97.  
  98.  
  99.  
  100. -- part 6 (button)
  101. -- low flags: 00
  102. -- high flags: A002
  103. -- rect: left=189 top=154 right=173 bottom=304
  104. -- title width / last selected line: 0
  105. -- icon id / first selected line: 0 / 0
  106. -- text alignment: 1
  107. -- font id: 0
  108. -- text size: 12
  109. -- style flags: 0
  110. -- line height: 16
  111. -- part name: Radians
  112. ----- HyperTalk script -----
  113. on mouseUp
  114.   ask "Enter Value"
  115.   put it into card field 4
  116.   put it*180/pi into card field 3
  117. end mouseUp
  118.  
  119.  
  120.  
  121. -- part 7 (field)
  122. -- low flags: 01
  123. -- high flags: 0002
  124. -- rect: left=188 top=127 right=144 bottom=303
  125. -- title width / last selected line: 0
  126. -- icon id / first selected line: 0 / 0
  127. -- text alignment: 1
  128. -- font id: 0
  129. -- text size: 12
  130. -- style flags: 0
  131. -- line height: 16
  132. -- part name: 
  133.  
  134.  
  135. -- part 8 (field)
  136. -- low flags: 01
  137. -- high flags: 0002
  138. -- rect: left=189 top=172 right=189 bottom=304
  139. -- title width / last selected line: 0
  140. -- icon id / first selected line: 0 / 0
  141. -- text alignment: 1
  142. -- font id: 0
  143. -- text size: 12
  144. -- style flags: 0
  145. -- line height: 16
  146. -- part name: 
  147.  
  148.  
  149. -- part 9 (button)
  150. -- low flags: 00
  151. -- high flags: A002
  152. -- rect: left=335 top=103 right=119 bottom=478
  153. -- title width / last selected line: 0
  154. -- icon id / first selected line: 0 / 0
  155. -- text alignment: 1
  156. -- font id: 0
  157. -- text size: 12
  158. -- style flags: 0
  159. -- line height: 16
  160. -- part name: Decimal
  161. ----- HyperTalk script -----
  162. on mouseUp
  163.   ask "Enter Integer Number"
  164.   put it into card field 5
  165.   set cursor to 4
  166.   hide message box
  167.   put it into num
  168.   put empty into ms
  169.   if offset(".",num)<>0 or offset("-",num)<>0 then put "Only Positive Integers are allowed" into ms
  170.   if ms is not empty then
  171.     play "boing"
  172.     put ms into message box
  173.     wait 80
  174.     hide message box
  175.     set cursor to 1
  176.     exit mouseup
  177.   end if
  178.   put trunc(ln(it)/ln(2)) into power
  179.   put empty into bin
  180.   put power into x
  181.   put 0 into p
  182.   repeat while x>=0
  183.     if p+(2^x)<=num then
  184.       add 2^x to p
  185.       put bin&"1" into bin
  186.     else
  187.       put bin&"0" into bin
  188.     end if
  189.     subtract 1 from x
  190.   end repeat
  191.   if num=0 then put "0" into bin
  192.   if length(bin)>17 then
  193.     put bin into message box
  194.     put "#################" into bin
  195.   end if
  196.   put bin into card field 6
  197.   ---
  198.   put trunc(ln(num)/ln(16)) into power
  199.   -- put num&&power into the message box
  200.   put power into x
  201.   put empty into hx
  202.   put 0 into p
  203.   repeat while x>=0
  204.     put trunc((num-p)/(16^x)) into mul
  205.     if p+(mul*(16^x)) <=num then
  206.       add (mul*(16^x)) to p
  207.       put mul into hxc
  208.       if hxc=10 then put "A" into hxc
  209.       if hxc=11 then put "B" into hxc
  210.       if hxc=12 then put "C" into hxc
  211.       if hxc=13 then put "D" into hxc
  212.       if hxc=14 then put "E" into hxc
  213.       if hxc=15 then put "F" into hxc
  214.       put hx&hxc into hx
  215.     else
  216.     end if
  217.     subtract 1 from x
  218.   end repeat
  219.   put hx into card field 7
  220.   set cursor to 1
  221. end mouseUp
  222.  
  223.  
  224.  
  225. -- part 10 (button)
  226. -- low flags: 00
  227. -- high flags: A002
  228. -- rect: left=335 top=136 right=151 bottom=478
  229. -- title width / last selected line: 0
  230. -- icon id / first selected line: 0 / 0
  231. -- text alignment: 1
  232. -- font id: 0
  233. -- text size: 12
  234. -- style flags: 0
  235. -- line height: 16
  236. -- part name: Binary
  237. ----- HyperTalk script -----
  238. on mouseUp
  239.   ask "Enter number in Binary form"
  240.   put it into bin
  241.   set cursor to 4
  242.   hide message box
  243.   if length(bin)>17 then
  244.     put bin into message box
  245.     put "#################" into card field 6
  246.   else
  247.     put bin into card field 6
  248.   end if
  249.   put empty into ms
  250.   put length(bin) into len
  251.   repeat with c=1 to len
  252.     if char c of bin <>"0" and char c of bin<>"1" then put "Use only 0's or 1's" into ms
  253.     if ms is not empty then
  254.       play "boing"
  255.       put ms into message box
  256.       wait 80
  257.       hide message box
  258.       put cursor into 1
  259.       exit mouseup
  260.     end if
  261.   end repeat
  262.   put 0 into num
  263.   put len into x
  264.   repeat while x>-1
  265.     add (char (len-x) of bin * 2^x) to num
  266.     subtract 1 from x
  267.   end repeat
  268.   put num into card field 5
  269.   --
  270.   put trunc(ln(num)/ln(16)) into power
  271.   put power into x
  272.   put empty into hx
  273.   put 0 into p
  274.   repeat while x>=0
  275.     put trunc((num-p)/(16^x)) into mul
  276.     if p+(mul*(16^x)) <=num then
  277.       add (mul*(16^x)) to p
  278.       put mul into hxc
  279.       if hxc=10 then put "A" into hxc
  280.       if hxc=11 then put "B" into hxc
  281.       if hxc=12 then put "C" into hxc
  282.       if hxc=13 then put "D" into hxc
  283.       if hxc=14 then put "E" into hxc
  284.       if hxc=15 then put "F" into hxc
  285.  
  286.       put hx&hxc into hx
  287.     else
  288.     end if
  289.     subtract 1 from x
  290.   end repeat
  291.   put hx into card field 7
  292.   set cursor to 1
  293. end mouseUp
  294.  
  295.  
  296.  
  297. -- part 11 (button)
  298. -- low flags: 00
  299. -- high flags: A002
  300. -- rect: left=335 top=167 right=182 bottom=478
  301. -- title width / last selected line: 0
  302. -- icon id / first selected line: 0 / 0
  303. -- text alignment: 1
  304. -- font id: 0
  305. -- text size: 12
  306. -- style flags: 0
  307. -- line height: 16
  308. -- part name: Hexadecimal
  309. ----- HyperTalk script -----
  310. on mouseUp
  311.   ask "Enter number in Hexadecimal form"
  312.   put it into bin
  313.   set cursor to 4
  314.   hide message box
  315.   put bin into card field 7
  316.   put empty into ms
  317.   put 0 into f
  318.   put length(bin) into len
  319.   repeat with c=1 to len
  320.     if chartonum(char c of bin) <48 then put 1 into f
  321.     if chartonum(char c of bin)>57 then
  322.       if chartonum(char c of bin)<65 then put 1 into f
  323.       if chartonum(char c of bin)>70 then
  324.         if chartonum(char c of bin)<97 and chartonum(char c of bin)>102 then put 1 into f
  325.       end if
  326.     end if
  327.     if f=1 then
  328.       play "boing"
  329.       put "This number is not a Hexadecimal number" into message box
  330.       wait 80
  331.       hide message box
  332.       set cursor to 1
  333.       exit mouseup
  334.     end if
  335.   end repeat
  336.  
  337.   put 0 into num
  338.   put 0 into x
  339.   repeat while x<=len
  340.     put char (len-x) of bin into hx
  341.     if hx="a" or hx="A" then put 10 into hx
  342.     if hx="b" or hx="B" then put 11 into hx
  343.     if hx="c" or hx="C" then put 12 into hx
  344.     if hx="d" or hx="D" then put 13 into hx
  345.     if hx="e" or hx="E" then put 14 into hx
  346.     if hx="f" or hx="F" then put 15 into hx
  347.     add hx*16^x to num
  348.     add 1 to x
  349.   end repeat
  350.   put num into card field 5
  351.   --
  352.   put trunc(ln(num)/ln(2)) into power
  353.   put empty into bin
  354.   put power into x
  355.   put 0 into p
  356.   repeat while x>=0
  357.     if p+(2^x)<=num then
  358.       add 2^x to p
  359.       put bin&"1" into bin
  360.     else
  361.       put bin&"0" into bin
  362.     end if
  363.     subtract 1 from x
  364.   end repeat
  365.   if num=0 then put "0" into bin
  366.   if length(bin)>17 then
  367.     put bin into message box
  368.     put "#################" into bin
  369.   end if
  370.   put bin into card field 6
  371.   set cursor to 1
  372. end mouseUp
  373.  
  374.  
  375.  
  376. -- part 12 (field)
  377. -- low flags: 01
  378. -- high flags: 0002
  379. -- rect: left=335 top=118 right=133 bottom=478
  380. -- title width / last selected line: 0
  381. -- icon id / first selected line: 0 / 0
  382. -- text alignment: 1
  383. -- font id: 0
  384. -- text size: 12
  385. -- style flags: 0
  386. -- line height: 16
  387. -- part name: 
  388.  
  389.  
  390. -- part 13 (field)
  391. -- low flags: 01
  392. -- high flags: 0002
  393. -- rect: left=335 top=149 right=164 bottom=478
  394. -- title width / last selected line: 0
  395. -- icon id / first selected line: 0 / 0
  396. -- text alignment: 1
  397. -- font id: 0
  398. -- text size: 12
  399. -- style flags: 0
  400. -- line height: 16
  401. -- part name: 
  402.  
  403.  
  404. -- part 14 (field)
  405. -- low flags: 01
  406. -- high flags: 0002
  407. -- rect: left=335 top=181 right=196 bottom=478
  408. -- title width / last selected line: 0
  409. -- icon id / first selected line: 0 / 0
  410. -- text alignment: 1
  411. -- font id: 0
  412. -- text size: 12
  413. -- style flags: 0
  414. -- line height: 16
  415. -- part name: 
  416.  
  417.  
  418. -- part 15 (button)
  419. -- low flags: 00
  420. -- high flags: A002
  421. -- rect: left=20 top=244 right=263 bottom=135
  422. -- title width / last selected line: 0
  423. -- icon id / first selected line: 0 / 0
  424. -- text alignment: 1
  425. -- font id: 0
  426. -- text size: 12
  427. -- style flags: 0
  428. -- line height: 16
  429. -- part name: Inches^4
  430. ----- HyperTalk script -----
  431. on mouseUp
  432.   ask "Enter Value"
  433.   put it into card field 8
  434.   put it*2.54^4 into card field 9
  435. end mouseUp
  436.  
  437.  
  438.  
  439. -- part 16 (button)
  440. -- low flags: 00
  441. -- high flags: A002
  442. -- rect: left=20 top=290 right=309 bottom=135
  443. -- title width / last selected line: 0
  444. -- icon id / first selected line: 0 / 0
  445. -- text alignment: 1
  446. -- font id: 0
  447. -- text size: 12
  448. -- style flags: 0
  449. -- line height: 16
  450. -- part name: Centimeters^4
  451. ----- HyperTalk script -----
  452. on mouseUp
  453.   ask "Enter Value"
  454.   put it into card field 9
  455.   put it/(2.54^4) into card field 8
  456. end mouseUp
  457.  
  458.  
  459.  
  460. -- part 17 (field)
  461. -- low flags: 01
  462. -- high flags: 0002
  463. -- rect: left=20 top=262 right=279 bottom=135
  464. -- title width / last selected line: 0
  465. -- icon id / first selected line: 0 / 0
  466. -- text alignment: 1
  467. -- font id: 0
  468. -- text size: 12
  469. -- style flags: 0
  470. -- line height: 16
  471. -- part name: 
  472.  
  473.  
  474. -- part 18 (field)
  475. -- low flags: 01
  476. -- high flags: 0002
  477. -- rect: left=20 top=308 right=325 bottom=135
  478. -- title width / last selected line: 0
  479. -- icon id / first selected line: 0 / 0
  480. -- text alignment: 1
  481. -- font id: 0
  482. -- text size: 12
  483. -- style flags: 0
  484. -- line height: 16
  485. -- part name: 
  486.  
  487.  
  488. -- part contents for card part 3
  489. ----- text -----
  490. 9.879013
  491.  
  492. -- part contents for card part 4
  493. ----- text -----
  494. 4.2
  495.  
  496. -- part contents for card part 7
  497. ----- text -----
  498. 57.29578
  499.  
  500. -- part contents for card part 8
  501. ----- text -----
  502. 1.00
  503.  
  504. -- part contents for card part 12
  505. ----- text -----
  506. 24
  507.  
  508. -- part contents for card part 13
  509. ----- text -----
  510. 11000
  511.  
  512. -- part contents for card part 14
  513. ----- text -----
  514. 18
  515.  
  516. -- part contents for card part 17
  517. ----- text -----
  518. 0.240251
  519.  
  520. -- part contents for card part 18
  521. ----- text -----
  522. 10
  523.  
  524. -- part contents for background part 5
  525. ----- text -----
  526. 1 --,fuel,fuel consumption,consumption,mpg,m/g,miles per gallon,mile per gallon,mile/gallon,miles/gallon,miles per gal,mile per gal,mile/gal,miles/gal,mi per gallon,mi/gallon,mi per gal,mi/gal,mil/gal,m/gal,mi/g,miles/g,mile/g,
  527. 2 --,kpl,kilometer per liter,kilometers per liter,kilometer/liter,kilometers/liter,km per liter,km/liter,kilometer per lit,kilometers per lit,kilometer/lit,kilometers/lit,km per lit,km/lit,k/lit,k/l,klm/liter,klm/lit,klm/l,km/liter,
  528. 3 --,angular units,pi,œÄ,‚àè,angular,angles,angle,angular measurements,angular measurement,degrees,
  529. 4 --,radian,radians,rad,angular,angles,angle,angular measurements,angular measurement,
  530. 5 --,numbers,number,decimal,decimals,base 10,decimal numbers,numbers to base ten,base ten,
  531. 6 --,binary,binary number,binary numbers,01,bin,0,1,off and on,off,on,off & on,off +on,
  532. 7 --,hexadecimal,hex,hex numbers,hexadecimal numbers,hex base,hexadecimals,hexdecimal bas,
  533. 8 --,moment of inertia,moment of,I,inches4,inches^4,in4,in^4,
  534. 9 --,centimeter to the 4,cm4,cm^4,centimeter^4